package com.sskj.one.transaction;


import com.sskj.common.base.HttpData;
import com.sskj.lib.http.JsonCallBack;
import com.sskj.one.bean.PositionBean;
import com.sskj.one.presenter.BasePresenter;

import java.util.List;

/**
 * @author Hey
 * Create at  2019/05/23
 */
class PositionPresenter extends BasePresenter<PositionFragment> {

    public void getPositonRecord(boolean showLoading, int page, int size) {
        httpService.getPositionRecord(page, size)
                .tag(this)
                .execute(new JsonCallBack<HttpData<List<PositionBean>>>(showLoading ? true : false) {
                    @Override
                    public void onHTTPSuccess(HttpData<List<PositionBean>> data) {
                        mView.getDataOK(data.getData());
                    }

                    @Override
                    public void onFinish() {
                        super.onFinish();
                        mView.stopRefresh();
                    }
                });
    }
}
